#pragma once
#include <string>
#include "motion/rtcmds.h"
namespace axis {

class AxisPower : public mot::RtCmdItf
{
public:
    AxisPower(uint32_t axisid, bool enable)
    {
        this->axisid = axisid;
        en_ = enable;
    }
    ~AxisPower() {}

    virtual int active_callback();
    virtual int process();

    uint32_t axisid;
    bool en_;
};

class AxisReset : public mot::RtCmdItf
{
public:
    AxisReset(uint32_t axisid) { this->axisid = axisid; }

    virtual int process();

    uint32_t axisid;
};

/**
 * @brief 设置当前轴的实际位置为指定值，内部会自动计算相对偏移量
*/
class AxisSetPosition : public mot::RtCmdItf
{
public:
    /**
    * @brief Set the position of the current axis to the specified value
    * @note 对于jaka自己的关节，其相对偏移量存储在伺服内部。而对于其他品牌的伺服，需要在控制器侧锁存相对偏移量
    */
    AxisSetPosition(uint32_t axisid, int pos, bool is_jaka = true)
    {
        this->axisid = axisid;
        this->pos = pos;
        this->is_jaka = is_jaka;
    }
    virtual int process();
    virtual int active_callback();

    uint32_t axisid;
    int pos;
    bool is_jaka;
};
}  // namespace axis